<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 100px;
            height: 100px;
            border: 1px solid red;
            background-color: aquamarine;
        }

        .box2 {
            width: 100px;
            height: 100px;
            border: 1px solid darkcyan;
            background-color: darksalmon;
        }
    </style>
</head>
<body>
    <div class="box1" draggable="true"> </div>
    <br/><br/><br/><br/>
    <div class="box2"></div>
    <script>
        var box2 = document.querySelector(".box1");

        box2.ondragenter = function() {
            console.log("coming");
        }

        box2.ondragover = function(e) {
            e.preventDefault();

            console.log("over head");
        }

        box2.ondrag = function() {
            console.log("draging ending");
        }

        box2.ondragleave = function() {
            console.log("the mouse leaved element");
        }
    </script>
</body> 
</html>